using System;
using System.Collections.Generic;
using System.Text;
using Sedodream.Sudoku.Evaluators;

namespace Sedodream.Sudoku.Board
{
	public class MoveScoreComparer : IComparer<IMove>
	{
		private static ScoreComparer proxy;

		private ScoreComparer Proxy
		{
			get
			{
				if (proxy == null)
					proxy = new ScoreComparer();
				return proxy;
			}
		}



		#region IComparer<IMove> Members

		public int Compare(IMove x, IMove y)
		{
			if (x == null)
				throw new ArgumentNullException("x");
			if (y == null)
				throw new ArgumentNullException("y");

			if (x == null)
				throw new ArgumentNullException("x");
			if (y == null)
				throw new ArgumentNullException("y");

			return Proxy.Compare(x.MoveScore, y.MoveScore);
		}
		#endregion
	}
}
